---
layout: "default"
title: "Operator: +="
description: "Swift documentation for the '+=' operator."
root: "/v1.2"
---

<code class="language-swift">infix operator += {
    associativity right
    precedence 90
    assignment
}</code>

<h3>Declarations</h3>

<div class="declaration" id="func-plseq-inout_-double-rhs_-double">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-inout_-double-rhs_-double">func +=(<wbr>inout:<wbr> Double, rhs: Double)</a>
        
<div class="comment collapse" id="comment-func-plseq-inout_-double-rhs_-double"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=(inout lhs: Double, rhs: Double)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-inout_-float-rhs_-float">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-inout_-float-rhs_-float">func +=(<wbr>inout:<wbr> Float, rhs: Float)</a>
        
<div class="comment collapse" id="comment-func-plseq-inout_-float-rhs_-float"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=(inout lhs: Float, rhs: Float)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-inout_-float80-rhs_-float80">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-inout_-float80-rhs_-float80">func +=(<wbr>inout:<wbr> Float80, rhs: Float80)</a>
        
<div class="comment collapse" id="comment-func-plseq-inout_-float80-rhs_-float80"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=(inout lhs: Float80, rhs: Float80)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-inout_-int-rhs_-int">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-inout_-int-rhs_-int">func +=(<wbr>inout:<wbr> Int, rhs: Int)</a>
        
<div class="comment collapse" id="comment-func-plseq-inout_-int-rhs_-int"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=(inout lhs: Int, rhs: Int)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-inout_-int8-rhs_-int8">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-inout_-int8-rhs_-int8">func +=(<wbr>inout:<wbr> Int8, rhs: Int8)</a>
        
<div class="comment collapse" id="comment-func-plseq-inout_-int8-rhs_-int8"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=(inout lhs: Int8, rhs: Int8)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-inout_-int16-rhs_-int16">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-inout_-int16-rhs_-int16">func +=(<wbr>inout:<wbr> Int16, rhs: Int16)</a>
        
<div class="comment collapse" id="comment-func-plseq-inout_-int16-rhs_-int16"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=(inout lhs: Int16, rhs: Int16)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-inout_-int32-rhs_-int32">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-inout_-int32-rhs_-int32">func +=(<wbr>inout:<wbr> Int32, rhs: Int32)</a>
        
<div class="comment collapse" id="comment-func-plseq-inout_-int32-rhs_-int32"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=(inout lhs: Int32, rhs: Int32)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-inout_-int64-rhs_-int64">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-inout_-int64-rhs_-int64">func +=(<wbr>inout:<wbr> Int64, rhs: Int64)</a>
        
<div class="comment collapse" id="comment-func-plseq-inout_-int64-rhs_-int64"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=(inout lhs: Int64, rhs: Int64)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-inout_-string-rhs_-string">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-inout_-string-rhs_-string">func +=(<wbr>inout:<wbr> String, rhs: String)</a>
        
<div class="comment collapse" id="comment-func-plseq-inout_-string-rhs_-string"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=(inout lhs: String, rhs: String)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-inout_-uint-rhs_-uint">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-inout_-uint-rhs_-uint">func +=(<wbr>inout:<wbr> UInt, rhs: UInt)</a>
        
<div class="comment collapse" id="comment-func-plseq-inout_-uint-rhs_-uint"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=(inout lhs: UInt, rhs: UInt)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-inout_-uint8-rhs_-uint8">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-inout_-uint8-rhs_-uint8">func +=(<wbr>inout:<wbr> UInt8, rhs: UInt8)</a>
        
<div class="comment collapse" id="comment-func-plseq-inout_-uint8-rhs_-uint8"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=(inout lhs: UInt8, rhs: UInt8)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-inout_-uint16-rhs_-uint16">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-inout_-uint16-rhs_-uint16">func +=(<wbr>inout:<wbr> UInt16, rhs: UInt16)</a>
        
<div class="comment collapse" id="comment-func-plseq-inout_-uint16-rhs_-uint16"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=(inout lhs: UInt16, rhs: UInt16)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-inout_-uint32-rhs_-uint32">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-inout_-uint32-rhs_-uint32">func +=(<wbr>inout:<wbr> UInt32, rhs: UInt32)</a>
        
<div class="comment collapse" id="comment-func-plseq-inout_-uint32-rhs_-uint32"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=(inout lhs: UInt32, rhs: UInt32)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-inout_-uint64-rhs_-uint64">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-inout_-uint64-rhs_-uint64">func +=(<wbr>inout:<wbr> UInt64, rhs: UInt64)</a>
        
<div class="comment collapse" id="comment-func-plseq-inout_-uint64-rhs_-uint64"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=(inout lhs: UInt64, rhs: UInt64)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-t_-integerarithmetictype-inout_-t-rhs_-t">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-t_-integerarithmetictype-inout_-t-rhs_-t">func <wbr>+= &lt;T : _IntegerArithmeticType&gt;(<wbr>inout:<wbr> T, rhs: T)</a>
        
<div class="comment collapse" id="comment-func-plseq-t_-integerarithmetictype-inout_-t-rhs_-t"><div class="p">
    <p>add <code>lhs</code> and <code>rhs</code> and store the result in <code>lhs</code>, trapping in
case of arithmetic overflow (except in -Ounchecked builds).</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;T : _IntegerArithmeticType&gt;(inout lhs: T, rhs: T)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-t_-unsignedintegertype-inout_-t-rhs_-t-disallowmixedsignarithmetic">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-t_-unsignedintegertype-inout_-t-rhs_-t-disallowmixedsignarithmetic">func <wbr>+= &lt;T : _UnsignedIntegerType&gt;(<wbr>inout:<wbr> T, rhs: T._DisallowMixedSignArithmetic)</a>
        
<div class="comment collapse" id="comment-func-plseq-t_-unsignedintegertype-inout_-t-rhs_-t-disallowmixedsignarithmetic"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;T : _UnsignedIntegerType&gt;(inout lhs: T, rhs: T._DisallowMixedSignArithmetic)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-t_-strideable-inout_-t-rhs_-t-stride">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-t_-strideable-inout_-t-rhs_-t-stride">func <wbr>+= &lt;T : Strideable&gt;(<wbr>inout:<wbr> T, rhs: T.Stride)</a>
        
<div class="comment collapse" id="comment-func-plseq-t_-strideable-inout_-t-rhs_-t-stride"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;T : Strideable&gt;(inout lhs: T, rhs: T.Stride)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-t-c_-collectiontype-where-t-t-inout_-t-rhs_-c">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-t-c_-collectiontype-where-t-t-inout_-t-rhs_-c">func <wbr>+= &lt;T, C : CollectionType where T == T&gt;(<wbr>inout:<wbr> [T], rhs: C)</a>
        
<div class="comment collapse" id="comment-func-plseq-t-c_-collectiontype-where-t-t-inout_-t-rhs_-c"><div class="p">
    <p>Extend <code>lhs</code> with the elements of <code>rhs</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;T, C : CollectionType where T == T&gt;(inout lhs: [T], rhs: C)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-t-c_-collectiontype-where-t-t-inout_-contiguousarraybuffer-t-rhs_-c">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-t-c_-collectiontype-where-t-t-inout_-contiguousarraybuffer-t-rhs_-c">func <wbr>+= &lt;T, C : CollectionType where T == T&gt;(<wbr>inout:<wbr> _ContiguousArrayBuffer&lt;T&gt;, rhs: C)</a>
        
<div class="comment collapse" id="comment-func-plseq-t-c_-collectiontype-where-t-t-inout_-contiguousarraybuffer-t-rhs_-c"><div class="p">
    <p>Append the elements of rhs to lhs</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;T, C : CollectionType where T == T&gt;(inout lhs: _ContiguousArrayBuffer&lt;T&gt;, rhs: C)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-t-c_-collectiontype-where-t-t-inout_-unittestarray-t-rhs_-c">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-t-c_-collectiontype-where-t-t-inout_-unittestarray-t-rhs_-c">func <wbr>+= &lt;T, C : CollectionType where T == T&gt;(<wbr>inout:<wbr> _UnitTestArray&lt;T&gt;, rhs: C)</a>
        
<div class="comment collapse" id="comment-func-plseq-t-c_-collectiontype-where-t-t-inout_-unittestarray-t-rhs_-c"><div class="p">
    <p>Extend <code>lhs</code> with the elements of <code>rhs</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;T, C : CollectionType where T == T&gt;(inout lhs: _UnitTestArray&lt;T&gt;, rhs: C)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-t-c_-collectiontype-where-t-t-inout_-unittestarraybuffer-t-rhs_-c">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-t-c_-collectiontype-where-t-t-inout_-unittestarraybuffer-t-rhs_-c">func <wbr>+= &lt;T, C : CollectionType where T == T&gt;(<wbr>inout:<wbr> _UnitTestArrayBuffer&lt;T&gt;, rhs: C)</a>
        
<div class="comment collapse" id="comment-func-plseq-t-c_-collectiontype-where-t-t-inout_-unittestarraybuffer-t-rhs_-c"><div class="p">
    <p>Append the elements of rhs to lhs</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;T, C : CollectionType where T == T&gt;(inout lhs: _UnitTestArrayBuffer&lt;T&gt;, rhs: C)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-t-c_-collectiontype-where-t-t-inout_-arrayslice-t-rhs_-c">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-t-c_-collectiontype-where-t-t-inout_-arrayslice-t-rhs_-c">func <wbr>+= &lt;T, C : CollectionType where T == T&gt;(<wbr>inout:<wbr> ArraySlice&lt;T&gt;, rhs: C)</a>
        
<div class="comment collapse" id="comment-func-plseq-t-c_-collectiontype-where-t-t-inout_-arrayslice-t-rhs_-c"><div class="p">
    <p>Extend <code>lhs</code> with the elements of <code>rhs</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;T, C : CollectionType where T == T&gt;(inout lhs: ArraySlice&lt;T&gt;, rhs: C)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-t-c_-collectiontype-where-t-t-inout_-contiguousarray-t-rhs_-c">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-t-c_-collectiontype-where-t-t-inout_-contiguousarray-t-rhs_-c">func <wbr>+= &lt;T, C : CollectionType where T == T&gt;(<wbr>inout:<wbr> ContiguousArray&lt;T&gt;, rhs: C)</a>
        
<div class="comment collapse" id="comment-func-plseq-t-c_-collectiontype-where-t-t-inout_-contiguousarray-t-rhs_-c"><div class="p">
    <p>Extend <code>lhs</code> with the elements of <code>rhs</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;T, C : CollectionType where T == T&gt;(inout lhs: ContiguousArray&lt;T&gt;, rhs: C)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-t-s_-sequencetype-where-t-t-inout_-t-rhs_-s">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-t-s_-sequencetype-where-t-t-inout_-t-rhs_-s">func <wbr>+= &lt;T, S : SequenceType where T == T&gt;(<wbr>inout:<wbr> [T], rhs: S)</a>
        
<div class="comment collapse" id="comment-func-plseq-t-s_-sequencetype-where-t-t-inout_-t-rhs_-s"><div class="p">
    <p>Extend <code>lhs</code> with the elements of <code>rhs</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;T, S : SequenceType where T == T&gt;(inout lhs: [T], rhs: S)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-t-s_-sequencetype-where-t-t-inout_-unittestarray-t-rhs_-s">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-t-s_-sequencetype-where-t-t-inout_-unittestarray-t-rhs_-s">func <wbr>+= &lt;T, S : SequenceType where T == T&gt;(<wbr>inout:<wbr> _UnitTestArray&lt;T&gt;, rhs: S)</a>
        
<div class="comment collapse" id="comment-func-plseq-t-s_-sequencetype-where-t-t-inout_-unittestarray-t-rhs_-s"><div class="p">
    <p>Extend <code>lhs</code> with the elements of <code>rhs</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;T, S : SequenceType where T == T&gt;(inout lhs: _UnitTestArray&lt;T&gt;, rhs: S)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-t-s_-sequencetype-where-t-t-inout_-arrayslice-t-rhs_-s">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-t-s_-sequencetype-where-t-t-inout_-arrayslice-t-rhs_-s">func <wbr>+= &lt;T, S : SequenceType where T == T&gt;(<wbr>inout:<wbr> ArraySlice&lt;T&gt;, rhs: S)</a>
        
<div class="comment collapse" id="comment-func-plseq-t-s_-sequencetype-where-t-t-inout_-arrayslice-t-rhs_-s"><div class="p">
    <p>Extend <code>lhs</code> with the elements of <code>rhs</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;T, S : SequenceType where T == T&gt;(inout lhs: ArraySlice&lt;T&gt;, rhs: S)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-t-s_-sequencetype-where-t-t-inout_-contiguousarray-t-rhs_-s">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-t-s_-sequencetype-where-t-t-inout_-contiguousarray-t-rhs_-s">func <wbr>+= &lt;T, S : SequenceType where T == T&gt;(<wbr>inout:<wbr> ContiguousArray&lt;T&gt;, rhs: S)</a>
        
<div class="comment collapse" id="comment-func-plseq-t-s_-sequencetype-where-t-t-inout_-contiguousarray-t-rhs_-s"><div class="p">
    <p>Extend <code>lhs</code> with the elements of <code>rhs</code></p>

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;T, S : SequenceType where T == T&gt;(inout lhs: ContiguousArray&lt;T&gt;, rhs: S)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-t-inout_-unittestarraybuffer-t-rhs_-t">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-t-inout_-unittestarraybuffer-t-rhs_-t">func += &lt;T&gt;(<wbr>inout:<wbr> _UnitTestArrayBuffer&lt;T&gt;, rhs: T)</a>
        
<div class="comment collapse" id="comment-func-plseq-t-inout_-unittestarraybuffer-t-rhs_-t"><div class="p">
    <p>Append rhs to lhs</p>

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;T&gt;(inout lhs: _UnitTestArrayBuffer&lt;T&gt;, rhs: T)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-t-inout_-unsafemutablepointer-t-rhs_-int">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-t-inout_-unsafemutablepointer-t-rhs_-int">func += &lt;T&gt;(<wbr>inout:<wbr> UnsafeMutablePointer&lt;T&gt;, rhs: Int)</a>
        
<div class="comment collapse" id="comment-func-plseq-t-inout_-unsafemutablepointer-t-rhs_-int"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;T&gt;(inout lhs: UnsafeMutablePointer&lt;T&gt;, rhs: Int)</code>
    
    
</div></div>
</div>
<div class="declaration" id="func-plseq-t-inout_-unsafepointer-t-rhs_-int">
<a class="toggle-link" data-toggle="collapse" href="#comment-func-plseq-t-inout_-unsafepointer-t-rhs_-int">func += &lt;T&gt;(<wbr>inout:<wbr> UnsafePointer&lt;T&gt;, rhs: Int)</a>
        
<div class="comment collapse" id="comment-func-plseq-t-inout_-unsafepointer-t-rhs_-int"><div class="p">
    

    <h4>Declaration</h4>    
    <code class="language-swift">func +=&lt;T&gt;(inout lhs: UnsafePointer&lt;T&gt;, rhs: Int)</code>
    
    
</div></div>
</div>
